﻿#include "RenderManager.h"

RenderManager* RenderManager::m_Instance = NULL;
QMutex RenderManager::m_Mutex;

RenderManager *RenderManager::GetInstance()
{
    QMutexLocker locker(&m_Mutex); // 在获取实列时进行加锁
    if (!m_Instance) {
        m_Instance = new RenderManager();
    }
    return m_Instance;
}

Render *RenderManager::GetRender(RENDER_TYPE Type,int Width,int Height)
{
    QMutexLocker locker(&m_Mutex);
    Render *render = NULL;
    if(Type == RENDER_TYPE::QT_RENDER)
    {
        render = new QtRender(RENDER_TYPE::QT_RENDER,Width,Height);
    }
    return render;
}

RenderManager::~RenderManager()
{

}
